<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<html>
<head><title>relation mapping</title></head>
	<script language="JavaScript">   
		function addRelation(user_id){
			parent.addRelation(user_id);
		}
	</script>
<body>
<table align="center">
<tr>
	<tr>
		<td>
		<p><font size="5">Authority List</font></p><br>
		<a href="javascript:addRelation(<s:property value="relations[0].user.id"/>);">Add Relation</a>
		    <table cellspacing="0" align="center">
			<thead>
		    <tr>
		        <th>Authority</th>
		        <th>Delete</th>
		    </tr>
		    </thead>
		    <tbody>
		    <s:iterator value="relations">
		    <tr>
		            <td align="center"><s:property value="authority.authority"/></td>
		            <td align="center">
		            	<a href='<s:url action="delete" ><s:param name="relationid" value="id" /></s:url>'>
			           	 Delete
			            </a>
		            </td>
		        </tr>
		    </s:iterator>
		    <tr align="right">
		    	<td colspan="9">
		    		共<s:property value="totalRow"/>行&nbsp;
		    		第<s:property value="currentPage"/>页&nbsp;
		    		共<s:property value="pager.getTotalPages()"/>页&nbsp;
		    		<a href="<s:url value="list.action">
		    			<s:param name="currentPage" value="currentPage"/>
		    			<s:param name="pagerMethod" value="'first'"/>
		    			
		    		</s:url>">首页</a>
		    		<a href="<s:url value="list.action">
		    			<s:param name="currentPage" value="currentPage"/>
		    			<s:param name="pagerMethod" value="'previous'"/>
		    		</s:url>">上一页</a>
		    		<a href="<s:url value="list.action">
		    			<s:param name="currentPage" value="currentPage"/>
		    			<s:param name="pagerMethod" value="'next'"/>
		    		</s:url>">下一页</a>
		    		<a href="<s:url value="list.action">
		    			<s:param name="currentPage" value="currentPage"/>
		    			<s:param name="pagerMethod" value="'last'"/>
		    		</s:url>">尾页</a>
		    	</td>
			</tr>

		    </tbody>
		</table>
		</td>
	</tr>
</table>
</body>
</html>
